<div class="row">
	<div class="col-xs-12">
		<!-- PAGE CONTENT BEGINS -->
		<form class="form-horizontal">
			<h4 class="smaller lighter blue">
				<i class="icon-search"> </i> <b>Filter </b>
			</h4>

			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right" for="provinsi"> Provinsi </label>
			
				<div class="col-sm-3">
					<select id="provinsi" name="provinsi" class="form-control"  <?= $ctr_provinsi ?> >		
						<option value="0"> Pilih Provinsi ...  </option>							
						<?php $provinsi = $queryprovinsi->result();foreach ($provinsi as $row) { ?>
							<option value="<?= $row->id_provinsi ?>"> <?= $row->nama_provinsi ?>  </option>
						<?php } ?>
					</select>
				</div>
			</div>		            

			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right" for="cabang"> Kantor Cabang </label>
			
				<div class="col-sm-3">
					<select id="cabang" name="cabang" class="form-control"  <?= $ctr_cabang ?> >		
						<option value="0"> Pilih Cabang ...  </option>							
						<?php $kota = $querykota->result();foreach ($kota as $row) { ?>
							<option value="<?= $row->id_kota ?>"> <?= $row->nama_kota ?>  </option>
						<?php } ?>
					</select>
				</div>
			</div>		            
			
			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right" for="customer"> Customer  </label>
			
				<div class="col-sm-3">
					<select id="customer" name="customer" class="form-control"  <?= $ctr_customer ?> >		
						<option value="0"> Pilih customer ...  </option>								
						<?php $customer = $querycustomer->result();foreach ($customer as $row) { ?>
							<option value="<?= $row->id_customer ?>"> <?= $row->nama_customer ?>  </option>
						<?php } ?>
					</select>
				</div>
			</div>
		</form>
		<div class="row">
			<div class="col-xs-12">
				<div class="table-header">
					Hasil Pencarian Data Karyawan
					<div  align='right'>    
        		        <a align='right' href=<?= base_url() ?>index.php/export_excel/cetak_excel_resign/<?= $this->uri->segment(3) ?>/<?= $this->uri->segment(4) ?>/<?= $this->uri->segment(5) ?> class="btn btn-xs btn-primary green"  data-toggle="modal" >
                			<i class="icon-plus bigger-110">
                    			Export Excel
                			</i>
            			</a>
	    			</div>
				</div>         

				<div class="table-responsive">
					<table id="sample-table-2" class="table table-striped table-bordered table-hover" align="center">
						<thead>
							<tr style="text-align:center">
								<th width="3"  rowspan="3" style="text-align:center">No</th> 
								<th <?php $role = $this->session->userdata('role'); if (!($role == '1' || $role =='2' || $role =='4' || $role =='6')){?> class="hide" <?php } ?> width="25" rowspan="3" style="text-align:center"> Edit/Delete </th>
								<th width="25" rowspan="3" style="text-align:center">Penanggungjawab</th>
								<th width="25" rowspan="3" style="text-align:center">Customer</th>
								<th width="25" rowspan="3" style="text-align:center">NIK Customer</th>
								<th width="25" rowspan="3" style="text-align:center">NIK SJS</th>
								<!--<th width="25" rowspan="3" style="text-align:center">Status</th>-->
								<th width="25" rowspan="3" style="text-align:center">Nama Karyawan</th>
								<th width="25" rowspan="3" style="text-align:center">Jabatan</th>
								<th width="25" rowspan="3" style="text-align:center">Departement</th>
								<th width="25" rowspan="3" style="text-align:center">Cabang</th>
								<th width="25" rowspan="3" style="text-align:center">Status Karyawan</th>
								<th width="25" colspan="1" style="text-align:center">Joint Customer</th>
								<th width="25" colspan="3" style="text-align:center">Cuti</th>
								<th width="25" colspan="3" style="text-align:center">Rekening</th>
								<th width="25" rowspan="3" style="text-align:center">Jenis Kelamin</th>
								<th width="25" colspan="2" style="text-align:center">Tempat dan Tanggal Lahir</th>
								<th width="25" rowspan="3" style="text-align:center">Agama</th>
								<th width="25" colspan="14" style="text-align:center">Alamat</th>
								<th width="25" colspan="6" style="text-align:center">Telepon</th>
								<th width="25" colspan="3" style="text-align:center">Pendidikan</th>
								<th width="25" colspan="2" style="text-align:center">Identitas Diri</th>
								<th width="25" rowspan="3" style="text-align:center">No. NPWP</th>
								<th width="25" colspan="3" style="text-align:center">Asuransi</th>
								<th width="25" colspan="3" style="text-align:center">Jaminan</th>
								<th width="25" rowspan="3" style="text-align:center">Nama Ibu Kandung</th>
								<th width="25" rowspan="3" style="text-align:center">Status Perkawinan</th>
								<th width="25" colspan="26" style="text-align:center">Susunan Keluarga</th>
								<th width="25" colspan="4" style="text-align:center">PKWT I</th>
								<th width="25" colspan="4" style="text-align:center">PKWT II</th>
								<th width="25" colspan="4" style="text-align:center">PKWT III</th>
								<th width="25" colspan="7" style="text-align:center">Surat Peringatan</th>
								<th width="25" colspan="3" style="text-align:center">Mutasi</th>
								<th width="25" rowspan="3" style="text-align:center">No. ID Card</th>
								<th width="25" colspan="3" style="text-align:center">Resign</th>
								<th width="25" colspan="14" style="text-align:center">Rincian Gaji</th>							</tr>
							<tr style="text-align:center">
								<th width="25" rowspan="2" style="text-align:center">Joint Awal</th>
								<th width="25" rowspan="2" style="text-align:center">Total Cuti</th>
								<th width="25" rowspan="2" style="text-align:center">Cuti Yg Sudah Diambil</th>
								<th width="25" rowspan="2" style="text-align:center">Sisa Cuti</th>
								<th width="25" rowspan="2" style="text-align:center">Bank</th>
								<th width="25" rowspan="2" style="text-align:center">No. Rekening</th>
								<th width="25" rowspan="2" style="text-align:center">Atas Nama</th>
								<th width="25" rowspan="2" style="text-align:center">Tempat</th>
								<th width="25" rowspan="2" style="text-align:center">Tgl. Lahir</th>
								<th width="25" rowspan="2" style="text-align:center">Alamat KTP</th>
								<th width="25" rowspan="2" style="text-align:center">RT</th>
								<th width="25" rowspan="2" style="text-align:center">RW</th>
								<th width="25" rowspan="2" style="text-align:center">Kode Pos</th></th>
								<th width="25" rowspan="2" style="text-align:center">Kecamatan</th>
								<th width="25" rowspan="2" style="text-align:center">Desa</th>
								<th width="25" rowspan="2" style="text-align:center">Kabupaten / Kotamadya</th>
								<th width="25" rowspan="2" style="text-align:center">Alamat Tidak Sesuai KTP</th>
								<th width="25" rowspan="2" style="text-align:center">RT</th>
								<th width="25" rowspan="2" style="text-align:center">RW</th>
								<th width="25" rowspan="2" style="text-align:center">Kode Pos</th></th>
								<th width="25" rowspan="2" style="text-align:center">Kecamatan</th>
								<th width="25" rowspan="2" style="text-align:center">Desa</th>
								<th width="25" rowspan="2" style="text-align:center">Kabupaten / Kotamadya</th>
								<th width="25" colspan="3" style="text-align:center">Telepon Pribadi</th>
								<th width="25" colspan="3" style="text-align:center">Telepon Keluarga Tidak Serumah</th>
								<th width="25" rowspan="2" style="text-align:center">Pendidikan Terakhir</th>
								<th width="25" rowspan="2" style="text-align:center">Nama Sekolah / Akademi / Universitas</th>
								<th width="25" rowspan="2" style="text-align:center">Jurusan</th>
								<th width="25" rowspan="2" style="text-align:center">Jenis (KTP/SIM)</th>
								<th width="25" rowspan="2" style="text-align:center">No. Kartu</th>
								<th width="25" rowspan="2" style="text-align:center">No. BPJS Ketenaga kerjaan</th>
								<th width="25" rowspan="2" style="text-align:center">No. BPJS Kesehatan</th>
								<th width="25" rowspan="2" style="text-align:center">Faskes I BPJS Kesehatan</th>
								<th width="25" rowspan="2" style="text-align:center">No. Ijasah</th>
								<th width="25" rowspan="2" style="text-align:center">No. BPKB</th>
								<th width="25" rowspan="2" style="text-align:center">Tempat Penyimpanan</th>
								<th width="25" rowspan="2" style="text-align:center">No. KK</th>
								<th width="25" colspan="5" style="text-align:center">Pasangan</th>
								<th width="25" colspan="5" style="text-align:center">Anak 1</th>
								<th width="25" colspan="5" style="text-align:center">Anak 2</th>
								<th width="25" colspan="5" style="text-align:center">Anak 3</th>
								<th width="25" colspan="5" style="text-align:center">Anak 4</th>
								<th width="25" rowspan="2" style="text-align:center">No. PKWT</th>
								<th width="25" rowspan="2" style="text-align:center">Awal Kontrak</th>
								<th width="25" rowspan="2" style="text-align:center">Akhir Kontrak</th>
								<th width="25" rowspan="2" style="text-align:center">Lama Kontrak</th>
								<th width="25" rowspan="2" style="text-align:center">No. PKWT</th>
								<th width="25" rowspan="2" style="text-align:center">Awal Kontrak</th>
								<th width="25" rowspan="2" style="text-align:center">Akhir Kontrak</th>
								<th width="25" rowspan="2" style="text-align:center">Lama Kontrak</th>
								<th width="25" rowspan="2" style="text-align:center">No. PKWT</th>
								<th width="25" rowspan="2" style="text-align:center">Awal Kontrak</th>
								<th width="25" rowspan="2" style="text-align:center">Akhir Kontrak</th>
								<th width="25" rowspan="2" style="text-align:center">Lama Kontrak</th>
								<th width="25" colspan="2" style="text-align:center">SP I</th>
								<th width="25" colspan="2" style="text-align:center">SP II</th>
								<th width="25" colspan="2" style="text-align:center">SP III</th>
								<th width="25" rowspan="2" style="text-align:center">PHK</th>
								<th width="25" rowspan="2" style="text-align:center">Dari</th>
								<th width="25" rowspan="2" style="text-align:center">Ke</th>
								<th width="25" rowspan="2" style="text-align:center">Tanggal Mutasi</th>
								<th width="25" rowspan="2" style="text-align:center">Tanggal Berhenti</th>
								<th width="25" rowspan="2" style="text-align:center">Alasan Berhenti</th>
								<th width="25" rowspan="2" style="text-align:center">Keterangan</th>
								<th width="25" rowspan="2" style="text-align:center">Gaji Pokok</th>
								<th width="25" rowspan="2" style="text-align:center">Allowance</th>
								<th width="25" rowspan="2" style="text-align:center">Uang Kehadiran</th>
								<th width="25" rowspan="2" style="text-align:center">Overtime</th>
								<th width="25" rowspan="2" style="text-align:center">Tunjangan Jabatan</th>
								<th width="25" rowspan="2" style="text-align:center">Tunjangan Transport</th>
								<th width="25" rowspan="2" style="text-align:center">Tunjangan Makan</th>
								<th width="25" rowspan="2" style="text-align:center">Tunjangan Pulsa</th>
								<th width="25" rowspan="2" style="text-align:center">Tunjangan Shift</th>
								<th width="25" rowspan="2" style="text-align:center">Komisi</th>
								<th width="25" rowspan="2" style="text-align:center">Incentive</th>
								<th width="25" rowspan="2" style="text-align:center">Bonus</th>
								<th width="25" rowspan="2" style="text-align:center">Adjustment</th>
								<th width="25" rowspan="2" style="text-align:center">Lain-lain</th>
							</tr>
							<tr style="text-align:center">
								<th width="25" rowspan="1" style="text-align:center">Rumah</th>
								<th width="25" rowspan="1" style="text-align:center">Ponsel</th>
								<th width="25" rowspan="1" style="text-align:center">Ponsel 2</th>
								<th width="25" rowspan="1" style="text-align:center">No. Telp</th>
								<th width="25" rowspan="1" style="text-align:center">Hubungan Keluarga</th>
								<th width="25" rowspan="1" style="text-align:center">Nama Keluarga</th>
								<th width="25" style="text-align:center">Nama</th>								
								<th width="25" style="text-align:center">No. KTP / NIK</th>								
								<th width="25" style="text-align:center">Jenis Kelamin</th>								
								<th width="25" style="text-align:center">Tempat Lahir</th>								
								<th width="25" style="text-align:center">Tgl. Lahir</th>								
								<th width="25" style="text-align:center">Nama</th>								
								<th width="25" style="text-align:center">No. KTP / NIK</th>								
								<th width="25" style="text-align:center">Jenis Kelamin</th>								
								<th width="25" style="text-align:center">Tempat Lahir</th>								
								<th width="25" style="text-align:center">Tgl. Lahir</th>								
								<th width="25" style="text-align:center">Nama</th>								
								<th width="25" style="text-align:center">No. KTP / NIK</th>								
								<th width="25" style="text-align:center">Jenis Kelamin</th>								
								<th width="25" style="text-align:center">Tempat Lahir</th>								
								<th width="25" style="text-align:center">Tgl. Lahir</th>								
								<th width="25" style="text-align:center">Nama</th>								
								<th width="25" style="text-align:center">No. KTP / NIK</th>								
								<th width="25" style="text-align:center">Jenis Kelamin</th>								
								<th width="25" style="text-align:center">Tempat Lahir</th>								
								<th width="25" style="text-align:center">Tgl. Lahir</th>								
								<th width="25" style="text-align:center">Nama</th>								
								<th width="25" style="text-align:center">No. KTP / NIK</th>								
								<th width="25" style="text-align:center">Jenis Kelamin</th>								
								<th width="25" style="text-align:center">Tempat Lahir</th>								
								<th width="25" style="text-align:center">Tgl. Lahir</th>								
								<th width="25" style="text-align:center">Tanggal</th>								
								<th width="25" style="text-align:center">Alasan SP</th>								
								<th width="25" style="text-align:center">Tanggal</th>								
								<th width="25" style="text-align:center">Alasan SP</th>								
								<th width="25" style="text-align:center">Tanggal</th>								
								<th width="25">Alasan SP</th>								
							</tr>
						</thead>
   	
						<tbody>
							<?php    
								function cek_pkwt($tanggal_awal,$tanggal_akhir)
								{
									//cek apakah tanggal awal adalah 01-01-1970
									$datetime1 = date_create($tanggal_awal);
									$datetime2 = date_create('01-01-1970');
									$interval = $datetime1->diff($datetime2);
									//$iInterval = $interval->format('%y')*365.25 + $interval->format('%m')*30 + $interval->format('%d');
									$iInterval = $interval->format('%R%a');
									//cek apakah tanggal akhir adalah 01-01-1970
									$datetime1 = date_create($tanggal_akhir);
									$datetime2 = date_create('01-01-1970');
									$interval = $datetime1->diff($datetime2);
									$iInterval2 = $interval->format('%R%a');
									
									$result = '-';	
									$iIntervalakhir = '';
									$iIntervalawal = '';
									if ($iInterval2 != 0) //jika tanggal awal tidak sama dengan 01-01-1970
									{
										//cek status karyawan
										$datetime1 = date_create($tanggal_akhir);
										$datetime2 = date_create('now');
										$interval = $datetime2->diff($datetime1);
										//$iInterval =  $interval->format('%y')*12 + $interval->format('%m');
										//echo "$iInterval";
										$iIntervalakhir = $interval->format('%R%a');
										if($iIntervalakhir < 30)
										{
											$result =  "yellow";
											if($iIntervalakhir < 0)
												$result = "red";
										}
										else
											$result = "grey";
									}
									if($iInterval != 0) //jika tanggal akhir tidak sama dengan 01-01-1970
									{
										//cek apakah karyawan baru
										$datetime1 = date_create($tanggal_awal);
										$datetime2 = date_create('now');
										$interval = $datetime1->diff($datetime2);
										//$iInterval = $interval->format('%y')*12 + $interval->format('%m');
										$iIntervalawal = $interval->format('%R%a');
										if($iIntervalawal <= 30)
											$result = "green";
									}
								 	//$result = $result . 'B' . $iIntervalakhir . 'A'. $iIntervalawal;
									return $result;
								}
							?>
							<?php $i = 1; foreach ($query as $row) { ?>
								<tr> 
									<td width="3"><?= $i++; ?></td>
									<td <?php $role = $this->session->userdata('role'); if(!($role == '1' || $role =='2' || $role =='4' || $role =='6')){?>class="hide" <?php } ?>>
										<!--<div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">-->
										<div style="text-align:center">
											<a class="green" href="<?=base_url()?>index.php/home/editdata/<?= $row->id ?>" title="edit" rel="tooltip">
												<i class="icon-pencil bigger-130"></i>
											</a> &nbsp
											<a href="#" id="<?php echo $row->id;?>" class="red hapuskaryawan" title="hapus" rel="tooltip">
												<i class="icon-trash bigger-130"></i>
											</a>
											<!--
											<a class="red" href="#">
												<i class="icon-trash bigger-130"></i>
											</a>
											-->
										</div>
										<!--
										<div class="visible-xs visible-sm hidden-md hidden-lg">
											<div class="inline position-relative">
												<button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown">
													<i class="icon-caret-down icon-only bigger-120"></i>
												</button>

												<ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
													<li>
														<a href="#" class="tooltip-info" data-rel="tooltip" title="View">
															<span class="blue">
																<i class="icon-zoom-in bigger-120"></i>
															</span>
														</a>
													</li>

													<li>
														<a href="#" class="tooltip-success" data-rel="tooltip" title="Edit">
															<span class="green">
																<i class="icon-edit bigger-120"></i>
															</span>
														</a>
													</li>

													<li>
														<a href="#" class="tooltip-error" data-rel="tooltip" title="Delete">
															<span class="red">
																<i class="icon-trash bigger-120"></i>
															</span>
														</a>
													</li>
												</ul>
											</div>
										</div>
										-->
									</td>
									<td style="width:200px"><?= $row->username_creator ?></td>
									<td style="width:200px"><?= $row->nama_customer ?></td>
									<td style="width:200px"><?= $row->nik_customer ?></td>
									<td width="25"><?= $row->nik_sjs ?></td>    	
									<!--<td width="25" style="background-color:green">Aktif</td>-->
									<td width="25"><?= $row->nama_kar ?></td>
									<td width="25"><?= $row->jabatan ?></td>
									<td width="25"><?= $row->departement ?></td>
									<td width="25"><?= $row->nama_kota ?></td>
									<?php
										$warna = ''; 
										$tmp = cek_pkwt($row->awal_kontrak_pkwt1,$row->akhir_kontrak_pkwt1);
										if($tmp != '-')
											$warna = $tmp;
										$tmp = cek_pkwt($row->awal_kontrak_pkwt2,$row->akhir_kontrak_pkwt2);
										if($tmp != '-')
											$warna = $tmp;
										$tmp = cek_pkwt($row->awal_kontrak_pkwt3,$row->akhir_kontrak_pkwt3);
										if($tmp != '-')
											$warna = $tmp;
										//cek apakah warnanya tidak ada
										if($warna == '')
											$warna = 'grey';
										//cek apakah status resign
										if(strtoupper($row->status_kar) == "RESIGN")
											$warna = 'red';
										
									?>
									<td width="25" style="background-color:<?= $warna ?>"><?= $row->status_kar ?></td>
									<td width="25"><?php if ($row->joint_awal == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->joint_awal)); ?></td>
									<td width="25"><?= $row->total_cuti ?></td>
									<td width="25"><?= $row->cuti_dipakai ?></td>
									<td width="25"><?= $row->sisa_cuti ?></td>
									<td width="25"><?= $row->bank ?></td>
									<td width="25"><?= $row->no_rekening ?></td>
									<td width="25"><?= $row->nama_rek ?></td>
									<td width="25"><?= $row->jenis_kelamin ?></td>
									<td width="25"><?= $row->tempat_lahir ?></td>
									<td width="25"><?php if ($row->tanggal_lahir == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->tanggal_lahir)); ?></td>
									<td width="25"><?= $row->agama ?></td>
									<td width="25"><?= $row->alamat_ktp ?></td>
									<td width="25"><?= $row->rt ?></td>
									<td width="25"><?= $row->rw ?></td>
									<td width="25"><?= $row->kode_pos ?></td>
									<td width="25"><?= $row->kecamatan ?></td>
									<td width="25"><?= $row->desa ?></td>
									<td width="25"><?= $row->kabupaten ?></td>
									<td width="25"><?= $row->alamat_tinggal ?></td>
									<td width="25"><?= $row->rt_tinggal ?></td>
									<td width="25"><?= $row->rw_tinggal ?></td>
									<td width="25"><?= $row->kode_pos_tinggal ?></td>
									<td width="25"><?= $row->kecamatan_tinggal ?></td>
									<td width="25"><?= $row->desa_tinggal ?></td>
									<td width="25"><?= $row->kabupaten_tinggal ?></td>
									<td width="25"><?= $row->tel_rumah ?></td>
									<td width="25"><?= $row->tel_hp ?></td>
									<td width="25"><?= $row->tel_hp2 ?></td>
									<td width="25"><?= $row->tel_keluarga ?></td>
									<td width="25"><?= $row->hub_keluarga ?></td>
									<td width="25"><?= $row->nama_keluarga ?></td>
									<td width="25"><?= $row->pendidikan ?></td>
									<td width="25"><?= $row->nama_sekolah ?></td>
									<td width="25"><?= $row->jurusan ?></td>
									<td width="25"><?= $row->jenis_identitas ?></td>
									<td width="25"><?= $row->no_identitas ?></td>
									<td width="25"><?= $row->no_npwp ?></td>
									<td width="25"><?= $row->no_jamsostek ?></td>
									<td width="25"><?= $row->bpjs ?></td>
									<td width="25"><?= $row->ppk_jamsostek ?></td>
									<td width="25"><?= $row->no_jaminan ?></td>
									<td width="25"><?= $row->no_bpkb ?></td>
									<td width="25"><?= $row->penyimpanan_jaminan ?></td>
									<td width="25"><?= $row->nama_ibu ?></td>
									<td width="25"><?= $row->status_perkawinan ?></td>
									<td width="25"><?= $row->no_kk ?></td>
									<td width="25"><?= $row->nama_suami_istri ?></td>
									<td width="25"><?= $row->no_ktp_nik_pasangan ?></td>
									<td width="25"><?= $row->jenis_kelamin_si ?></td>
									<td width="25"><?= $row->tempat_lahir_si ?></td>
									<td width="25"><?php if ($row->tgl_lahir_si == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->tgl_lahir_si)); ?></td>
									<td width="25"><?= $row->nama_anak1 ?></td>
									<td width="25"><?= $row->no_ktp_nik_anak1 ?></td>
									<td width="25"><?= $row->jenis_kelamin_anak1 ?></td>
									<td width="25"><?= $row->tempat_lahir_anak1 ?></td>
									<td width="25"><?php if ($row->tgl_lahir_anak1 == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->tgl_lahir_anak1)); ?></td>
									<td width="25"><?= $row->nama_anak2 ?></td>
									<td width="25"><?= $row->no_ktp_nik_anak2 ?></td>
									<td width="25"><?= $row->jenis_kelamin_anak2 ?></td>
									<td width="25"><?= $row->tempat_lahir_anak2 ?></td>
									<td width="25"><?php if ($row->tgl_lahir_anak2 == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->tgl_lahir_anak2)); ?></td>
									<td width="25"><?= $row->nama_anak3 ?></td>
									<td width="25"><?= $row->no_ktp_nik_anak3 ?></td>
									<td width="25"><?= $row->jenis_kelamin_anak3 ?></td>
									<td width="25"><?= $row->tempat_lahir_anak3 ?></td>
									<td width="25"><?php if ($row->tgl_lahir_anak3 == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->tgl_lahir_anak3)); ?></td>
									<td width="25"><?= $row->nama_anak4 ?></td>
									<td width="25"><?= $row->no_ktp_nik_anak4 ?></td>
									<td width="25"><?= $row->jenis_kelamin_anak4 ?></td>
									<td width="25"><?= $row->tempat_lahir_anak4 ?></td>
									<td width="25"><?php if ($row->tgl_lahir_anak4 == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->tgl_lahir_anak4)); ?></td>
									<td width="25"><?= $row->no_pkwt1 ?></td>
									<td width="25"><?php if ($row->awal_kontrak_pkwt1 == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->awal_kontrak_pkwt1)); ?></td>
									<td width="25"><?php if ($row->akhir_kontrak_pkwt1 == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->akhir_kontrak_pkwt1)); ?></td>
									<td width="25"><?= $row->lama_kontrak1 ?></td>
									<td width="25"><?= $row->no_pkwt2 ?></td>
									<td width="25"><?php if ($row->awal_kontrak_pkwt2 == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->awal_kontrak_pkwt2)); ?></td>
									<td width="25"><?php if ($row->akhir_kontrak_pkwt2 == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->akhir_kontrak_pkwt2)); ?></td>
									<td width="25"><?= $row->lama_kontrak2 ?></td>
									<td width="25"><?= $row->no_pkwt3 ?></td>
									<td width="25"><?php if ($row->awal_kontrak_pkwt3 == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->awal_kontrak_pkwt3)); ?></td>
									<td width="25"><?php if ($row->akhir_kontrak_pkwt3 == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->akhir_kontrak_pkwt3)); ?></td>
									<td width="25"><?= $row->lama_kontrak3 ?></td>
									<td width="25"><?php if ($row->tanggal_sp1 == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->tanggal_sp1)); ?></td>
									<td width="25"><?= $row->alasan_sp1 ?></td>
									<td width="25"><?php if ($row->tanggal_sp2 == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->tanggal_sp2)); ?></td>
									<td width="25"><?= $row->alasan_sp2 ?></td>
									<td width="25"><?php if ($row->tanggal_sp3 == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->tanggal_sp3)); ?></td>
									<td width="25"><?= $row->alasan_sp3 ?></td>
									<td width="25"><?= $row->status_phk ?></td>
									<td width="25"><?= $row->mutasi_dari ?></td>
									<td width="25"><?= $row->mutasi_ke ?></td>
									<td width="25"><?php if ($row->tanggal_mutasi == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->tanggal_mutasi)); ?></td>
									<td width="25"><?= $row->no_id_card ?></td>
									<td width="25"><?php if ($row->tanggal_berhenti == '1970-01-01') echo '-';else echo date('d-m-Y', strtotime($row->tanggal_berhenti)); ?></td>
									<td width="25"><?= $row->alasan_berhenti ?></td>
									<td width="25"><?= $row->keterangan ?></td>
									<td width="25"><?= $row->gaji_pokok ?></td>
									<td width="25"><?= $row->allowance ?></td>
									<td width="25"><?= $row->uang_kehadiran ?></td>
									<td width="25"><?= $row->overtime ?></td>
									<td width="25"><?= $row->tunjangan_jabatan ?></td>
									<td width="25"><?= $row->tunjangan_transport ?></td>
									<td width="25"><?= $row->tunjangan_makan ?></td>
									<td width="25"><?= $row->tunjangan_pulsa ?></td>
									<td width="25"><?= $row->tunjangan_shift ?></td>
									<td width="25"><?= $row->komisi ?></td>
									<td width="25"><?= $row->incentive ?></td>
									<td width="25"><?= $row->bonus ?></td>
									<td width="25"><?= $row->adjustment ?></td>
									<td width="25"><?= $row->lain ?></td>
								</tr>
							<?php } ?>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div><!-- /.col -->
</div><!-- /.row -->
						
						
		<!-- basic scripts -->

		<!--[if !IE]> -->

		<script type="text/javascript">
			window.jQuery || document.write("<script src='<?= base_url() ?>assets/js/jquery-2.0.3.min.js'>"+"<"+"/script>");
		</script>

		<!-- <![endif]-->

		<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='<?= base_url() ?>assets/js/jquery-1.10.2.min.js'>"+"<"+"/script>");
</script>
<![endif]-->

		<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='<?= base_url() ?>assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>

		<!-- page specific plugin scripts -->

		<script src="<?= base_url() ?>assets/js/jquery.dataTables.min.js"></script>
		<script src="<?= base_url() ?>assets/js/jquery.dataTables.bootstrap.js"></script>

		<!-- inline scripts related to this page -->

		<script type="text/javascript">
        	$(function() {
            	$(".hapuskaryawan").click(function(){ 
                	var element = $(this);
                	var del_id = element.attr("id");
                	var info = 'id=' + del_id;
                	var con;
                	if(con=confirm("Apakah anda ingin menghapus data karyawan ini?"))
                	{
                  		if(con==true){
                 			$.ajax({
                   				type: "POST",
                   				url:siteUrl+'/home/hapuskaryawan',
                   				data: info,
                   				success: function(){        
	                   				location.reload();
                   				}
                        	});
                    		$(this).parents(".record").animate({ backgroundColor: "#fbc7c7" }, "slow")
                  			.animate({ opacity: "hide" }, "slow");
                 		}
                 		else
                 		{
                    		window.location.href=siteUrl+'/home/listdataresign';
                 		}
                 	}
                	return false;
                });
       		});
        </script>
		<script type="text/javascript">
			jQuery(function($) {
				var oTable1 = $('#sample-table-2').dataTable( {
				"aoColumns": [
			      { "bSortable": false },
			      { "bSortable": false }, 
			      null,null, null, null, null,null, null, null, null,null, null,null, null, null, null,null, null, null, null, null,
			      null, null,null, null, null, null,null, null, null, null,null, null,null, null, null, null,null, null, null, null,
			      null, null,null, null, null, null,null, null, null, null,null, null,null, null, null, null,null, null, null, null,
			      null, null,null, null, null, null,null, null, null, null,null, null,null, null, null, null,null, null, null, null,
			      null, null,null, null, null, null,null, null, null, null,null, null,null, null, null, null,null, null, null, null,
				  null, null,null, null, null, null,null, null, null, null,null, null,null, null, null, null,null, null, null, null,
				] } );
				
				
				$('table th input:checkbox').on('click' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
						
				});
			
			
				$('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
				function tooltip_placement(context, source) {
					var $source = $(source);
					var $parent = $source.closest('table')
					var off1 = $parent.offset();
					var w1 = $parent.width();
			
					var off2 = $source.offset();
					var w2 = $source.width();
			
					if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
					return 'left';
				}  
			});
		</script>
		<script type="text/javascript">
				$(document).ready(function(){
                	$('#provinsi').change(function(){
                		var id_provinsi= $("#provinsi").val();
                		var id_kota= $("#cabang").val();
                		var id_customer= $("#customer").val();
                   		window.location.href = siteUrl+"/home/listdataresign/"+id_kota+"/"+id_customer+"/"+id_provinsi;				
                    });
                	$('#customer').change(function(){
                		var id_provinsi= $("#provinsi").val();
                		var id_kota= $("#cabang").val();
                		var id_customer= $("#customer").val();
                   		window.location.href = siteUrl+"/home/listdataresign/"+id_kota+"/"+id_customer+"/"+id_provinsi;				
                    });
                	$('#cabang').change(function(){
                		var id_provinsi= $("#provinsi").val();
                		var id_kota= $("#cabang").val();
                		var id_customer= $("#customer").val();
                   		window.location.href = siteUrl+"/home/listdataresign/"+id_kota+"/"+id_customer+"/"+id_provinsi;				
					});
					//update dropdown pilihan kota
					if($('#provinsi').val() != 0)
	                {	
	                	$.post("<?php echo site_url(); ?>/user/get_kabupatenkota/"+ $('#provinsi').val(), {}, function(obj) {
    	                	$('#cabang').html(obj);                
               	 		});
					}
				});
		</script>
		<script type="text/javascript">
				document.getElementById('provinsi').value="<?= $this->uri->segment(5) ?>";
				document.getElementById('customer').value="<?= $this->uri->segment(4) ?>";
				document.getElementById('cabang').value="<?= $this->uri->segment(3) ?>";
  				$(document).ajaxStop(function () {
					document.getElementById('cabang').value="<?= $this->uri->segment(3) ?>";
  				});
		</script>
